﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PatternFactory
{
    public class CarFactory : IFactory
    {
        public static Car GetCar(string name)
        {

            if (name == "Tesla")
            { 
                return new CarTesla(); 
            }
            else if (name == "mobai")
            {
                return new CarMobai();
            }
            else { return null; } 

        }



    }
}
